package us.wili.dev.common.util.xinge.v2;

/**
 * author: lefore
 * date: 2018/8/29
 */
public enum XinGeErrorCode {

    SUCCESS(0, "调用成功"),
    PARAM_ERROR(-1, "参数错误"),
    REQUEST_TIMESTAMP_INVALID(-2, "请求时间戳不在有效期内"),
    RECV_FAIL(-3, "recv失败"),
    ACTION_TIMEOUT(-5, "Action 处理超时"),
    INVALID_PARAM(2, "非法参数"),
    COMMUNICATE_CMEM_FAIL(5, "与CEM通讯失败"),
    DEVICE_TOKEN_NOT_REGISTER(6, "设备 token 未成功注册"),
    COMMON_ERROR_ACCOUNT_EXCEED_LIMIT(7, "删除其他未使用的账号（调用账号解绑）"),
    TOKEN_INVALID(14, "token 非法"),
    PUSH_LOGIC_SERVER_BUSY(15, "推送逻辑服务器繁忙"),
    SYSTEM_BUSY(16, "系统繁忙"),
    OPERATE_SEQUENCE_ERROR(19, "操作时序错误"),
    AUTHENTICATE_ERROR(20, "鉴权错误"),
    TOKEN_NOT_REGISTER_IN_XINGE(40, "推送的 token 没有在信鸽中注册"),
    ACCOUNT_NOT_BIND_TOKEN(40, "推送的账号没有绑定 token"),
    DEVICE_NOT_REGISTER(48, "设备未注册"),
    MSG_CHAR_TOO_LONG(73, "消息字符数超限"),
    MSG_BODY_NOT_JSON_FORMAT(75, "消息体格式不符合 json 格式"),
    REQUEST_FREQUENTLY(76, "请求过于频繁，请稍后再试"),
    LOOP_TASK_PARAM_ERROR(78, "循环任务参数错误"),
    DEVICE_OFFLINE(90, "设备离线"),
    DEVICE_TAG_TOO_MUCH(91, "设备 tag 过多"),
    APP_TAG_TOO_MUCH(92, "apptag 过多"),
    APNS_CERTIFICATE_ERROR(100, "APNS 证书错误，请重新提交正确的证书"),
    PARAM_ERROR2(-101, "参数错误"),
    REQUEST_TIMESTAMP_EXPIRE(-102, "请求 timestamp 字段超过了时间过期"),
    SIGN_INVALID(-103, "sign 不合法"),
    REQUEST_FREQUENTLY2(-105, "请求过于频繁"),
    CERTIFICATE_ERROR(-106, "证书错误"),
    LOSS_COMMON_PARAM(-111, "缺少公共参数:access_id timestamp sign"),
    PARAM_VALUE_INVALID(-112, "参数取值非法"),
    INTERNAL_ERROR(-10000, "内部错误"),;

    private Integer code;
    private String msg;

    XinGeErrorCode(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
